// JavaScript Document  
   $(document).ready(function(){
        var range = 1080;             //距下边界长度/单位px
		var elemt = 1000;           //插入元素高度/单位px
        var maxnum = 100;            //设置加载最多次数
        var num = 1;
		var Num = 25;
        var totalheight = 800; 
        var main = $(".zongtigundong");                     //主体元素
        $(window).scroll(function(){
            var srollPos = $(window).scrollTop();    //滚动条距顶部距离(页面超出窗口的高度)
            //console.log("滚动条到顶部的垂直高度: "+$(document).scrollTop());
            //console.log("页面的文档高度 ："+$(document).height());
            //console.log('浏览器的高度：'+$(window).height());
            
            totalheight = parseFloat($(window).height()) + parseFloat(srollPos);
            if(($(document).height()-range) <= totalheight  && num != maxnum ) {
				
				var Random = parseInt(100*Math.random());    //产生0-100的随机数
				
                var textnode=main.append("<div class='zongtigundong1' style='margin-top:221.75px;' >
										  <div class='tp'>
							              <img src='../1601170204ChenZhenSong\16软件2班\domo02\3-动态页面\img ("+num+").jpg' width='200' height='200' 
										  alt='img1' style='width:167px; height:124px;'/></div><div class='mc'>菜式（"+Num+"）</div>
										  <div class='jg'>＄"+Random+"</div>
										  <input id='btn' name='btn1' type='button' value='查看' onclick='cdClick()' style='width:100px; height:70px;'></div>");
                num++;  
				Num++;
			
            }
        });
    });
	
	function cdClick(){
	alert("该菜式详细情况的消息");
	}